package com.guslegend.spzx.manager.service.exception;

import com.guslegend.spzx.model.vo.common.ResultCodeEnum;

/**
 * @author: guslegend
 * @description: 自定义异常类
 * @create: 2025-04-29 09:15
 **/
public class GuiguException extends RuntimeException{

    private Integer code ;          // 错误状态码
    private String message ;        // 错误消息

    private ResultCodeEnum resultCodeEnum ;     // 封装错误状态码和错误消息

    public GuiguException(ResultCodeEnum resultCodeEnum) {
        this.resultCodeEnum = resultCodeEnum ;
        this.code = resultCodeEnum.getCode() ;
        this.message = resultCodeEnum.getMessage();
    }

    public GuiguException(Integer code , String message) {
        this.code = code ;
        this.message = message ;
    }
}
